package com.hhj.sell.service.impl;

import com.hhj.sell.dao.ProductCategoryDao;
import com.hhj.sell.pojo.ProductCategory;
import com.hhj.sell.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private ProductCategoryDao productCategoryDao;

    @Override
    public ProductCategory findone(Integer categoryId) {

        return productCategoryDao.findById(categoryId).get();
    }
    @Override
    public List<ProductCategory> findAll() {
        return productCategoryDao.findAll();
    }

    @Override
    public List<ProductCategory> findByCategotyTypeIn(List<Integer> categoryType) {
        return productCategoryDao.findByCategoryTypeIn(categoryType);
    }

    @Override
    public ProductCategory save(ProductCategory productCategory) {

        return productCategoryDao.save(productCategory);
    }
}
